package com.vhall.component.controller.account.facade.console;

import com.alibaba.fastjson.JSONObject;
import com.vhall.component.entity.account.vo.*;
import com.vhall.component.entity.rbac.vo.RolePermissionConsoleRequestVO;
import com.vhall.component.entity.rbac.vo.RolePermissionConsoleResponseVO;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * 控制台用户登录登出
 *
 * @author longzhen.gong
 * @date 2021/6/9 16:37   主持人登录  v4/account/console/auth/login
 */
@Api(tags = "CslAuthController", value = "控制台用户")
@FeignClient(value = "CslAuthFacade", path = "/v4/account/console/auth")
public interface CslAuthFacade {

    /**
     * console端控制台登录
     *
     * @param authLoginVO 参数
     * @return 返回值
     */
    @ApiOperation("登录")
    @PostMapping("/login")
    AuthLoginRspVO login(@Validated AuthLoginVO authLoginVO);

    /**
     * 嘉宾助理登录
     * @param authLoginVO
     * @return
     */
    @ApiOperation("嘉宾助理登录")
    @PostMapping("/assistant-login")
    AuthLoginRspVO assistantLogin(@Validated AuthLoginVO authLoginVO);

    /**
     * console端控制台sso登录
     *
     * @param vo 参数
     * @return 返回值
     */
    @ApiOperation("登录")
    @PostMapping("/login-sso")
    AuthLoginRspVO loginSso(@Validated AuthConsoleLoginSsoVO vo);

    /**
     * console端控制台登出
     *
     * @param authLogoutVO 参数值
     */
    @ApiOperation("登出")
    @PostMapping(value = "/logout")
    void logout(@Validated AuthLogoutVO authLogoutVO);

    /**
     * 获取账户 控制台菜单权限
     *
     * @return 返回值
     */
    @PostMapping(value = "/permission")
    JSONObject permission();

    /**
     * 获取用户角色的菜单权限
     * 2023年08月05日
     * @param requestVO 参数
     * @return List<RolePermissionConsoleResponseVO>
     */
    @TokenAuth
    @GetMapping(value = "/role-permission")
    List<RolePermissionConsoleResponseVO> rolePermissionConsole(RolePermissionConsoleRequestVO requestVO);


    /**
     * 切换当前登录用户的角色
     * @param vo
     * @return
     */
    @TokenAuth
    @PostMapping("/change-account-role")
    ChangeAccountRoleResponseVO changeAccountRole(ChangeAccountRoleRequestVO vo);
}
